module.exports = function (app) {
    return new Handler(app);
};

var Handler = function (app) {
    this.app = app;
};

var handler = Handler.prototype;

handler.enter = function (msg, session, next) {
    var rid = msg.rid || 'admin';
    var uid = msg.uid;
    session.bind(uid);
    session.set('rid', rid);
    session.push('rid', function (err) {
        if (err) {
            console.error('set rid for session service failed! error is : %j', err.stack);
        }
    });
    next(null, {code: 200, msg: "welcome!!!"});
};